package com.biaobiaoqi.scoreanalysis.administrator.action;

import javax.annotation.Resource;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.biaobiaoqi.scoreanalysis.service.IExaminationService;
import com.opensymphony.xwork2.ActionSupport;

public class DeleteExam extends ActionSupport {
 	private static final long serialVersionUID = -7814375296419220509L;
 	private static final Log log = LogFactory.getLog(DeleteExam.class);
 	
 	private int id;
 	@Resource
 	private IExaminationService examinationService;
 	
 	public String execute() {
		log.debug("delete exam.");
		try {
			examinationService.deleteExamination(id);
			return SUCCESS;
		} catch (Exception e) {
			log.error("delete exam failed: ",e);
			addActionError("服务器内部错误");
			return ERROR;
		}
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public IExaminationService getExaminationService() {
		return examinationService;
	}

	public void setExaminationService(IExaminationService examinationService) {
		this.examinationService = examinationService;
	}
}
